﻿using VI.Fsc.Common.Util;
using VI.Fsc.OperatorGui.Models.Fsc.Configuration;

namespace VI.Fsc.OperatorGui.Models.Fsc
{
    public class Scope
    {
        private readonly string value;

        public Scope(string value)
        {
            this.value = value;
        }

        public string GetFullItemPath(string item)
        {
            return value + "/" + item;
        }

        public static Scope Create(CFsc cFsc)
        {
            return !string.IsNullOrWhiteSpace(OperatorGuiApplicationSettings.Instance.Scope) ?
                new Scope(OperatorGuiApplicationSettings.Instance.Scope) : 
                new Scope(cFsc.GetSorterSectionPath());
        }
    }
}